<?php


namespace services\linkedcare;

use common\models\linkedcare\LinkedcareTags;
use Yii;
use common\components\Service;

class LinkedcareTagsService extends Service
{
    /**
     * E看牙渠道下拉筛选项
     * @return array[]
     */
    public static function getTagsCondition(): array
    {
        return LinkedcareTags::find()
            ->select(['id value', 'name title'])
            ->where(['status' => [LinkedcareTags::STATUS_INVALID, LinkedcareTags::STATUS_ENABLE]])
            ->asArray()
            ->all();
    }

    /**
     * 新增患者默认标签
     * @return array
     */
    public static function getAddPatientTags(): array
    {
        $linkedcareTags = LinkedcareTags::findOne(['name' => '综合']);
        return [
            ['tagId' => $linkedcareTags->tag_id]
        ];
    }
}
